import React, { Component } from 'react'

import { Button,Rate } from 'antd';

import { 
  RateWrapper,
  ContentTitle,
  Content,
} from '../style'


export default (props) => {
  return (
    <RateWrapper>
      <ContentTitle>
        课程评分
      </ContentTitle>
      <Content>
        <p>觉得老师说的怎么样，快来打分吧~</p>
        <Rate allowHalf disabled  value={props.rate ? parseFloat(props.rate.get('score')) : 0} />
        <Button type="primary" style={{marginLeft: '46px'}} onClick={()=> props.showModal()}>
          去打分
        </Button>
      </Content>
      <ContentTitle>
        练习题
      </ContentTitle>
      <Content>
        <p>学习结束啦，快来做点习题巩固一下知识点吧~</p>
        <div style={{width: "156px", margin: "0 auto"}}>
          <Button type="primary" block disabled={props.homeWork.size > 0 ? false : true} onClick={()=> props.startAnswer()}>
            开始练习
          </Button>
        </div>
      </Content>
    </RateWrapper>
  )
}
